/* Copyright (c) 2011-2021 Columbia University, System Level Design Group */
/* SPDX-License-Identifier: Apache-2.0 */

#ifndef SHA1_TESTS_H
#define SHA1_TESTS_H

#define N_TESTS 13

static unsigned sha1_raw_in_bytes[N_TESTS] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 262, 6400};

// ATTENTION: SHA1 output is 5 32-bit words, DMA is 64 bits
// Add an extra word of zeros at the end.
static unsigned sha1_raw_out_bytes[N_TESTS] = {24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4, 24+4};

static unsigned sha1_raw_in_words[N_TESTS] = {0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 16,  66, 1600};

// ATTENTION: SHA1 output is 5 32-bit words, DMA is 64 bits
// Add an extra word of zeros at the end.
static unsigned sha1_raw_out_words[N_TESTS] = {5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1, 5+1};

static unsigned sha1_raw_inputs[N_TESTS][1600] = {
    {0x00000000, 0x00000000}, // SHA1ShortMsg 0
    {0x36000000, 0x00000000}, // SHA1ShortMsg 8
    {0x195a0000, 0x00000000}, // SHA1ShortMsg 16
    {0xdf4bd200, 0x00000000}, // SHA1ShortMsg 24
    {0x549e959e, 0x00000000}, // SHA1ShortMsg 32
    {0xf7fb1be2, 0x05000000}, // SHA1ShortMsg 40
    {0xc0e5abea, 0xea630000}, // SHA1ShortMsg 48
    {0x63bfc1ed, 0x7f78ab00}, // SHA1ShortMsg 56
    {0x7e3d7b3e, 0xada98866}, // SHA1ShortMsg 64
    {0x9e61e55d, 0x9ed37b1c, 0x20000000, 0x00000000}, // SHA1ShortMsg 72
    {0x45927e32, 0xddf801ca, 0xf35e18e7, 0xb5078b7f, 0x54352782, 0x12ec6bb9, 0x9df884f4, 0x9b327c64, // SHA1ShortMsg 512
     0x86feae46, 0xba187dc1, 0xcc914512, 0x1e1492e6, 0xb06e9007, 0x394dc33b, 0x7748f86a, 0xc3207cfe},
    {0x6cb70d19, 0xc096200f, 0x9249d2db, 0xc04299b0, 0x085eb068, 0x257560be, 0x3a307dbd, 0x741a3378, // SHA1LongMsg 2096
     0xebfa03fc, 0xca610883, 0xb07f7fea, 0x563a8665, 0x71822472, 0xdade8a0b, 0xec4b9820, 0x2d47a344,
     0x312976a7, 0xbcb39644, 0x27eacb5b, 0x0525db22, 0x066599b8, 0x1be41e5a, 0xdaf157d9, 0x25fac04b,
     0x06eb6e01, 0xdeb753ba, 0xbf33be16, 0x162b214e, 0x8db01721, 0x2fafa512, 0xcdc8c0d0, 0xa15c10f6,
     0x32e8f4f4, 0x7792c64d, 0x3f026004, 0xd173df50, 0xcf0aa797, 0x6066a79a, 0x8d78deee, 0xec951dab,
     0x7cc90f68, 0xd16f7866, 0x71feba0b, 0x7d269d92, 0x941c4f02, 0xf432aa5c, 0xe2aab619, 0x4dcc6fd3,
     0xae36c843, 0x3274ef6b, 0x1bd0d314, 0x636be47b, 0xa38d1948, 0x343a38bf, 0x9406523a, 0x0b2a8cd7,
     0x8ed6266e, 0xe3c9b5c6, 0x0620b308, 0xcc6b3a73, 0xc6060d52, 0x68a7d82b, 0x6a33b93a, 0x6fd6fe1d,
     0xe55231d1, 0x2c970000},
    {0x3a14145d, 0xd1fa9e46, 0xc4562eed, 0x0b0da10d, 0x845ad84f, 0x43cdb16e, 0x29933699, 0xb8f71519,
     0x25295133, 0xaf3e3650, 0x3079925b, 0xf2c9226b, 0xc3924ba2, 0x4cb00a55, 0x9eba2e6c, 0x0e83c50c,
     0x43e7d474, 0x8dc44b25, 0x78463746, 0xa2683a46, 0xc9b738c3, 0x285954ab, 0x044f1ba1, 0x82f7fea2,
     0xbbd506e8, 0x1292c30e, 0xc6458676, 0xc3f2d0e8, 0xbe50097b, 0x80d075b9, 0x82da65fe, 0xbb5aaa21,
     0xb67b4f56, 0xe7b28853, 0x3fffe5b2, 0xfe70cb97, 0xc9e62592, 0xfc1b57c7, 0x41e4734c, 0x62b4b0d2,
     0x5b621888, 0xb42c803c, 0x0dfbbdc3, 0xfbe9159c, 0x1200f4d0, 0x4344e01c, 0x69f4af52, 0x1e0ef8fd,
     0xd311c744, 0x20069511, 0x58c17772, 0x6165953f, 0xc226defd, 0xfe53fa02, 0x219380da, 0x986f6aea,
     0x4510c653, 0xd34aae19, 0x47da7985, 0xd8ec33c7, 0x01e14be0, 0xd44e8cbf, 0x91484eaa, 0x77dfeee0,
     0xdae87b7d, 0x7600b29d, 0x03cd2dc4, 0x0a87d77e, 0xf6b7a342, 0x6e3f7e9c, 0xe29b828c, 0x64666c29,
     0xba205089, 0xb12e8be5, 0xb422faf9, 0x9c3d69aa, 0xca324eeb, 0x732db8e1, 0x3c148245, 0x070dcc0b,
     0x0c40ab41, 0x2bde2039, 0x806247ea, 0x3917d194, 0xa4dab4a3, 0x8c2121d6, 0xc63cb7a0, 0x07dbf6cf,
     0xf9d1f66b, 0x8d1759e1, 0x92147e60, 0x871bf784, 0xad363e32, 0x6122a3c3, 0xa99a8964, 0x0dd9d2bc,
     0xa85a98d0, 0x7ee21e24, 0x10c00623, 0x2e53c4c1, 0x0dce525f, 0x993825ef, 0x0cb76158, 0xc00d491c,
     0x4163f938, 0xa746574c, 0x23ef47fb, 0xd7c71e95, 0xeb2a5af3, 0xdd6b90a3, 0x1819a546, 0xc9814135,
     0xee74816b, 0xaf4bec9f, 0xf227a9b0, 0x2a7eef46, 0x6fd3bcb7, 0xd4c4ca27, 0xf54abff4, 0xcf3da351,
     0xd5169830, 0x40f9c566, 0xa6f39409, 0xce801d1d, 0xc350e270, 0x274abcc3, 0xcad2152a, 0x7b4758b6,
     0x1ed0a650, 0xff59cbe8, 0x66d870d0, 0x6cd59162, 0x0c2932e9, 0x7d064ebf, 0xbf3711b2, 0x75a947ac,
     0xf22b1394, 0x9672e46f, 0x5b60a5cb, 0xab86345d, 0x75e716e9, 0x7ffe6962, 0xfe031953, 0x646b577d,
     0x79ae47c1, 0xad4cf941, 0xac129bc3, 0x3499ed56, 0x2311f537, 0xd53cf3f5, 0xacbd97d4, 0xf093726f,
     0xdae1aba2, 0xebf0f3a7, 0x8276ba7f, 0xae19a394, 0x412f369c, 0x26c8d6c0, 0xf4eef2fe, 0xc22b7fcc,
     0x3e4ca5fe, 0xf965b8e9, 0x05156bc9, 0xc20b4060, 0xf5c943e0, 0x1aa8f80b, 0xfc1d9299, 0x823a65da,
     0xcc789e9c, 0x7eb3324f, 0x5c761467, 0x1879ab02, 0x676883cb, 0x5ae6431e, 0xecd2df6d, 0xd8c90ee2,
     0xadecff45, 0x23e34721, 0xb0221f22, 0x576accc2, 0xc1935e24, 0x8e8a9d40, 0xed964141, 0x6adf612b,
     0x08302ec1, 0x90fce1a6, 0x289ff2c2, 0x27e78be7, 0x28d33cb5, 0x5e9af0bb, 0x27ef20de, 0xe38446ff,
     0x06cd95d8, 0x6c06e727, 0xed77f70f, 0x32f7d0bb, 0xc6af8544, 0x702023d5, 0xc168e40d, 0xe9c0a5a4,
     0xcf4a9a52, 0x600a41ec, 0x263194d1, 0x1da28384, 0xc3afa19a, 0x6f231ed7, 0xe386f594, 0x249c6663,
     0x8a2fa7f6, 0x130ed73d, 0xfc5633cf, 0x93f08c8b, 0x475bf97f, 0x01acc909, 0xb7d3bb3b, 0x3e1f7284,
     0x5f05238d, 0x2e1d9162, 0x976d3bd2, 0x3aead318, 0x793cf3bb, 0xcec20cb2, 0x62d69fcc, 0xdc52af4f,
     0x775276df, 0x583c57a2, 0x1efe14a2, 0xba974173, 0x81d9f815, 0x7f6dcf1b, 0x0f17070d, 0xa93b060c,
     0xfaa107b4, 0x3a751147, 0xba922507, 0xbc00bce3, 0x88ba7156, 0xbcb5fa8d, 0xe41f5cc8, 0x4ae45f02,
     0x107740d4, 0x7bcfa797, 0x92b0d8c9, 0xe82b2db1, 0xb668c446, 0x2ca3754e, 0x097507c3, 0x6a55a37a,
     0xdf5e8807, 0xc45301db, 0xcfe094af, 0xe5227d26, 0x326a5bad, 0x783e28a6, 0xa7a16ec7, 0xaf95b8bc,
     0x92dd4714, 0xbd07075a, 0x98aac282, 0x5ced9288, 0x25489c53, 0x488ffbdf, 0xe62cfb9b, 0xc1ab8810,
     0x4f7de6c4, 0x0df5a25e, 0x1697c80a, 0xf492561f, 0xb68bf100, 0x429cd740, 0xed9d1509, 0x49a2fabe,
     0x3ec4cbdf, 0x5d25b82d, 0x702e0f0f, 0x561bb035, 0x0ebac17b, 0x116fa210, 0xe57c23d7, 0xef7ff50d,
     0x893c5f2d, 0x549d3210, 0xcff7ff59, 0x298f8710, 0x545d738d, 0x5b104698, 0xf5528fce, 0x5a4c6347,
     0x556d0a75, 0x9b67f94f, 0x5b7b00af, 0x16f7c5f9, 0xb1fd71fe, 0xc985a920, 0x46a5c0b6, 0x33112bb2,
     0xcdde3581, 0xd98bf432, 0x3b417bdb, 0xc55a5138, 0x4d212296, 0x02d8b5ef, 0x00001e57, 0x21d43596,
     0x16174617, 0xb70f0a01, 0x98d2d6a3, 0xddc01315, 0x4f51ee1c, 0xaf11504f, 0x4ae81178, 0xcd9f693d,
     0x5ba0a700, 0xddfd2503, 0x99b47bd0, 0x0732f3d8, 0xdf153d5a, 0x77366486, 0x4ce701e3, 0xde79afee,
     0xc202be04, 0xf25c2c81, 0x6771d02a, 0xeab6d9c8, 0x27f67716, 0x0351d8dd, 0x2f84565e, 0xfd6beff0,
     0x73c4f5ea, 0x9f3506c3, 0x29913f78, 0x2f57ad2e, 0x4c7b0419, 0xfa69949c, 0x1b4878b2, 0xd27b118c,
     0x976eb37c, 0x8b8f9d11, 0x089a2f84, 0x7d1a5752, 0x792d4d2b, 0x0587800b, 0x37b9d0a7, 0x04b3fd0a,
     0x56885f80, 0x5e72d8b3, 0x2c160814, 0x7d09bf7c, 0xd492b813, 0xccb28472, 0xac61c404, 0x3c1b9bb2,
     0xd79b63bf, 0xc2e79ff0, 0xbc8c31f1, 0xd62bcef4, 0x8534ae9b, 0xf6f28818, 0xa1c8bd93, 0x21bad4cb,
     0x432e2601, 0x5df4da12, 0xe18514e3, 0x31886a01, 0xb59b9889, 0x2c4f7446, 0x3f74241a, 0x5c988e9f,
     0xc1ca100d, 0xd7a4715f, 0xc28818b1, 0x36297ced, 0x8c4ddca6, 0x15d23044, 0xaeef5f62, 0x94bdb274,
     0x7af689ad, 0xd9fc4d20, 0x881da525, 0x8c15edfe, 0x31d4e4ba, 0x5a82a45a, 0x15c1d833, 0x72322993,
     0x963af9a7, 0x0b06549c, 0x5acc2305, 0xdc54a37d, 0xcdb8168d, 0xa268b9d0, 0x9c70f554, 0x9efed944,
     0x3c1ec8c4, 0x14c96f1d, 0x611efa1a, 0xcdef88b2, 0x877fdce6, 0x968a55ed, 0x6d86208f, 0xbf29accf,
     0x942b5ecc, 0x9d4d87e9, 0xc49a932c, 0x08ed83e4, 0x88b39d8f, 0xddf261fa, 0xad8bc0aa, 0x7dbc897b,
     0xc7e82487, 0x4d9b8249, 0xacc95403, 0x34567b5c, 0xf7dbc04e, 0x20a8c63f, 0x87053c6e, 0x82be5791,
     0xfdde80bd, 0xcdba4a85, 0x4131a666, 0xfa335a63, 0xfd80afec, 0x07b26a04, 0x217efea3, 0x73370059,
     0x5d93db35, 0xc4b2c5e5, 0xaa5cf21e, 0x028b073f, 0xc229d131, 0x391a3791, 0xa37d6d11, 0xfb2f6b1b,
     0x10919eb8, 0xdb8cddb1, 0x10d29ef4, 0xf3666a38, 0x6d5e8ee4, 0x5fe8142d, 0x368bf17f, 0xc0af801f,
     0x3e602f0e, 0xba4f7930, 0x9a1914ad, 0x76cc6b98, 0x27a84ecf, 0x2022e822, 0x022ff2b7, 0x6abe27ac,
     0x0d86f8ff, 0x080380ab, 0x71bbba14, 0x32c6f2a5, 0x178d79b8, 0x25d29db6, 0x2ef1d87f, 0xa265480c,
     0xa88d5f53, 0x6db0dc6a, 0xbc40faf0, 0xd05be7a9, 0x66977768, 0x16ff1a32, 0xe2590ca0, 0x10abcb85,
     0x35fdced1, 0x935f74b5, 0xa42e3b08, 0xf79432ea, 0x3b4eb1a7, 0x9ab247de, 0x48f0f4e2, 0x5b989860,
     0xdd5cac42, 0x1f1830d4, 0x510fe425, 0x5077bbb1, 0xbf398d3c, 0x59f20c01, 0x853df90c, 0x2b3498e5,
     0xc734616e, 0xbce1f80e, 0xea6a5f0f, 0x820f6b45, 0x19e074f1, 0xfcc751e4, 0xc4c883e8, 0x2a88b15b,
     0x1c0c551d, 0x10c4b4ad, 0x98c8138e, 0x366128f0, 0x72cbcf8c, 0x2b39fed0, 0x2b1afb3c, 0xfe9bcc0c,
     0x036df017, 0xc3c84cf7, 0x82b0686a, 0x1477dbf8, 0xf28304d6, 0x8d51fb0b, 0xe2bac7d1, 0x4f75d23e,
     0xa5de9a23, 0x7ef5a835, 0xd1aac66a, 0xc3586da6, 0xc08f7d97, 0xcb1630dd, 0x1230516f, 0xc61fa93a,
     0x29e7bb0b, 0xe954b1ae, 0xac3e9558, 0xec0cc442, 0x0577a097, 0x8c918690, 0xe30500dd, 0x0aa03b48,
     0xb810bb95, 0xabec4dac, 0x3cf53dfa, 0x369cca14, 0xe8c4d79d, 0x79c8e36b, 0x7cc03be5, 0xc4006eaf,
     0x7ae2028a, 0x6cc66575, 0xa8562618, 0x4a0f6563, 0x92fd8973, 0x3ac531b5, 0x06e96c4d, 0x9c482cb9,
     0x96e4f8b1, 0xd6e8e252, 0x19eab97c, 0xcf6d7f79, 0x2baa1ddf, 0x769056b7, 0xa809fade, 0x397f5cac,
     0x359f05d4, 0x8f5caa8b, 0xb7375ced, 0x6ebeff9c, 0xda53fdaa, 0xd52f3cb9, 0x8ba74d60, 0x44ade6d1,
     0x7e9992b9, 0x3f2aa768, 0xa9c77832, 0xcf0bcd15, 0xc781909c, 0x01acc902, 0xd64bcd9b, 0x64dab170,
     0x9a5c0529, 0x8f58bf31, 0x18227614, 0x995bd12c, 0x1bbb3e7c, 0x9f0ee7dc, 0xb27de257, 0x420fa7d1,
     0xb070c8ec, 0x26f0dc2d, 0x2bcebc5b, 0x75b7f328, 0xfe8a6f14, 0x5a5e7d8d, 0x47c6f45b, 0x8654af3b,
     0xe95b41ca, 0xaef9e5a5, 0x0b55b4cf, 0x0a261b53, 0x97758b2a, 0xd7a3725e, 0xbcad6b70, 0xd7afb1f8,
     0x6da7da8b, 0xcc7cc2e1, 0xdf3fc537, 0x01b031f3, 0x0f04fa87, 0xc1e5b097, 0x3abbaf5e, 0xdd2a964e,
     0x63dbfaf6, 0x2a805b29, 0xd012565d, 0x015d1d51, 0x8dbf25f3, 0xbe2d1e80, 0xe87628ed, 0x41cc4486,
     0xf38008d5, 0x700d98c5, 0x0658d107, 0xb336c7b5, 0x3a2f7235, 0x7682a461, 0xef683ee4, 0xab9da4e7,
     0x471d6eee, 0x462b61fc, 0xa8989dfe, 0xbe421766, 0x3edb4a17, 0x93ec2a81, 0x76195a0d, 0xc2a69ebb,
     0x843a9309, 0x52e39e18, 0xdf5b220a, 0xcc8af6ae, 0xc04b165f, 0xba739829, 0xa610e22e, 0x2fee1b48,
     0xd560dff0, 0x3f3c375f, 0xd228c8f2, 0x82144ad3, 0xe8083cd6, 0x9520d6a1, 0xa7d54010, 0x9a7d01d8,
     0x6015ba6a, 0xb33f141a, 0xaa87f780, 0x8aeafd1e, 0xdf992644, 0xccfacd31, 0xa0f0da7b, 0xa95c3ab1,
     0x4de48c3e, 0x56f31d90, 0x8e00177a, 0x8c14f5d7, 0xcd863a71, 0x07096321, 0xb9ea1a37, 0x0792ac1b,
     0xc552bd35, 0xd2603b0b, 0xa71c90a9, 0x2f981c46, 0xda58e224, 0xed5681b8, 0x1c49670b, 0x5a274160,
     0xf0e9b517, 0xcc8e54d1, 0x1c62cad5, 0x1c8058b3, 0x2c968527, 0x26e8103f, 0xee9828c0, 0x4b24dfc7,
     0xf530ddac, 0xef86512b, 0x165b2ec6, 0xfbd49365, 0xeec88a40, 0x5bc8f6fe, 0x5a5cc71e, 0x81907097,
     0xfcaf9bbb, 0xe04f1b61, 0xbd8d2243, 0x739ab4a5, 0x46775b38, 0x34fc1d3d, 0x851fabed, 0xa573db19,
     0x2fef580e, 0x4af198bb, 0x38820f16, 0x2cdca3bb, 0x5c2a5fd6, 0x588e6b44, 0x9a683cf5, 0x5ed60895,
     0xb4777d6b, 0xd375b281, 0xb0c25e05, 0xcfa148ef, 0x5969fee4, 0x7085ca5a, 0xbfc0e2fe, 0x55c0df52,
     0xb3cf709b, 0x23e250fa, 0x4cd375d9, 0x04f28b88, 0x65bca028, 0x23ea21c9, 0x1cae05cf, 0x3139489a,
     0x55809b66, 0xe3405a6f, 0x353fbe59, 0x72d654d0, 0xa7acad6c, 0x1ac457d7, 0xdbba0d31, 0x9b492bb3,
     0xc1116593, 0xbb97b728, 0x928e9f4f, 0xc2558b0d, 0x48c08d76, 0xfc1b56cd, 0x216c62ec, 0x3bf970e6,
     0x200a35ec, 0x52f0516d, 0x8c468281, 0x9b771888, 0x6f81a90e, 0x72f805f3, 0x194d6cc8, 0xb850ff7b,
     0x9af47537, 0x51520f86, 0x4bf1ceb9, 0xa645e389, 0x457567fe, 0x24624c90, 0xe8e4948d, 0xbb56c0ba,
     0x56568c3d, 0x5fc6d9ba, 0xf616ebbd, 0x8bc6d458, 0xf226300d, 0xb96113ed, 0xb9b94002, 0xeb149ceb,
     0x7db8e2c6, 0x25539753, 0xb63e4155, 0xf102d43c, 0x9d1c6d02, 0xdafd4253, 0xb255d9f0, 0xf1917955,
     0x36a2df9a, 0x4b013197, 0xb2f0384b, 0x8002c97f, 0x6fdd84a6, 0x2e3fc208, 0xfb3fc81f, 0x74d64141,
     0xaa9deb80, 0x78d890cf, 0x13b43866, 0xe1cd9d67, 0x8ff3dfc1, 0x5e2e7954, 0xbdff7457, 0x1de9daf7,
     0x01306e41, 0x54e19a42, 0x0012a96d, 0xbc6b363d, 0x25e6e41b, 0x11d25081, 0x201e4460, 0x94d42ebf,
     0x62e4d0a5, 0x8823383a, 0xa293f329, 0xb8e57e48, 0x5b3cfd7b, 0xf0342fd6, 0x4b23a201, 0x809f23e1,
     0xf5407974, 0xbca653fd, 0x20be7e62, 0x7e425bd2, 0x577f91aa, 0xa25bff9a, 0x6796f504, 0x8950a3a4,
     0xe4ccd176, 0x9773d1d4, 0xa31cb2df, 0xb68ab721, 0x41360771, 0xd04fa616, 0x9b00a42f, 0x58f19552,
     0x54104173, 0xc2919c07, 0x5333f86a, 0x07c6797e, 0x42eac996, 0x22190e92, 0x10e8194b, 0x9589e031,
     0x6f952f32, 0xe5089ade, 0x578eb6c9, 0x19fd8931, 0x82223ee1, 0x3fc01d55, 0xedd6bb1f, 0xe8216e8a,
     0x5de2047c, 0xa7e1b5a1, 0xd8b255c5, 0x9537cf82, 0x2866ce1c, 0xd04cbda9, 0x5b52f275, 0xf7c026a4,
     0x467f2919, 0xb023d397, 0xfd293e26, 0x237c32b9, 0x5c3ee10d, 0x7cc6d5d4, 0x82e52613, 0x6d6ef0c9,
     0x51f504d1, 0xa9d6de09, 0xef7ad8b4, 0x6ad59d1d, 0x4833df7e, 0xec354d1f, 0x8916bfc2, 0xf033b43f,
     0xa6cbff6c, 0x3a03bd3f, 0xd52d8a37, 0x1349f5f7, 0x11cc3135, 0xc8a10dd2, 0x996e254a, 0x28185a4f,
     0x6e8981b1, 0x0ab15881, 0xd8cabe76, 0xc5e1238f, 0xe2923dfa, 0xb713fc35, 0xd974c173, 0xbf24cb41,
     0xd1b8f169, 0xc2e89717, 0x20dadb3a, 0x29a40f2d, 0xe10c6c97, 0x61910490, 0x72b0f905, 0x5a60ed5d,
     0xf6dfb95c, 0x09b06248, 0xd4e5494b, 0xe79aa119, 0x36c226d2, 0x6f260c2a, 0x8baa36c7, 0xa4d2a9eb,
     0x06864052, 0x8812a15e, 0x1d716f71, 0xa6cbc29a, 0x0a3cd475, 0x89d7fd4c, 0x4debe182, 0x4284e832,
     0x2835ee13, 0xe7153c9f, 0x2208b774, 0x0e4058fa, 0x8503dc46, 0x56aebd3e, 0xe0fa60fe, 0xdf7e907b,
     0x85752b66, 0xcdc21b54, 0x0c31881b, 0xc8004c7f, 0xce9ea80e, 0x7fb23548, 0x6b5f1d03, 0x21c68a0e,
     0x44cd5f15, 0xe21f27c4, 0x02754a2f, 0x7c138772, 0x0e959e94, 0xabeb4db2, 0x16a37e59, 0xb066bf33,
     0x8fc6f2e6, 0xcf374639, 0x2d5a6679, 0xd182f01b, 0x6c7128a2, 0x8362eec3, 0x0b4dedc7, 0x35661632,
     0x8be64da2, 0x3c0f61f9, 0xb46a42be, 0x70546ec1, 0x11b8adfe, 0xaf1efec4, 0x6fe5d117, 0x58cc7652,
     0x62b8d611, 0xd0b1614d, 0xc02d47c9, 0x0191ebad, 0x24f59571, 0xd62766fd, 0x6df3920f, 0xc0a2c9dc,
     0x3cc1f6fa, 0x34242c7d, 0x792add61, 0x2b414e28, 0xcead47c3, 0xa0860fb6, 0x2a009878, 0x16f0f618,
     0x408b1526, 0x1070acd1, 0x06e96d4d, 0x966d7f78, 0x376a2dbc, 0xb742e037, 0xd1934a19, 0x01bce54e,
     0x979d9c5e, 0x0b9ec791, 0x90f25d56, 0xeb1d65e5, 0x86b3ae24, 0xc063c0c7, 0x883512bc, 0x2a107ec6,
     0x687ff168, 0xcdb46704, 0x3ece1744, 0xd257eab9, 0xe41132c2, 0x66f299b0, 0x776d5727, 0x38f3a9c7,
     0xdcba7e0c, 0xffbd7373, 0x390401df, 0xf225f53a, 0x780b215f, 0x4ef65238, 0xc8c38223, 0xd46e4e9b,
     0x1bd5aa14, 0x49bed326, 0xa81c85ee, 0xf48e6fb2, 0x6b29e4c3, 0x2377d3a8, 0xa0bff978, 0xa6875588,
     0x4c58dc46, 0x52c16f65, 0xb49e0a3b, 0x7f9b3e67, 0xe4f3e1b6, 0x8b7e0448, 0x2aea25ee, 0x5548a6d7,
     0x98cb7e6c, 0xc3cd2f78, 0x8513f88c, 0x3c524ba2, 0x0cf28100, 0x2e11cd5f, 0x8bcb6e4d, 0x8ab929d0,
     0x26b7f74c, 0x43ebfba6, 0x4203b6aa, 0xd3bd7eaa, 0x0aad2c68, 0xb63b1637, 0xeeeb3d5c, 0xece1c7ba,
     0x1fa4afaf, 0x7b22bb39, 0x14f4ae5d, 0xebe4bfc9, 0x07ac4bb8, 0xc801c716, 0x79d0f8e4, 0x24c866df,
     0xaa180e5c, 0x127a5777, 0x2270476c, 0x2ccdf745, 0x2b7844b6, 0x0f6dc845, 0x540409ad, 0xd976ef85,
     0xf09d7c1d, 0xb1fbb7a9, 0x95fee9a1, 0x40820c67, 0x9d98812b, 0x3086010c, 0xa80fd67f, 0xb4f44bf5,
     0x18ba61b8, 0x00aec316, 0x9427fcc2, 0xcc0be877, 0x869468de, 0xd6545ab2, 0x9d77c922, 0x5d496077,
     0x4bf825f6, 0xa69a6408, 0x4871e898, 0x7b6e71bd, 0x0df56399, 0xa7e0bc81, 0x5ac6485d, 0x7b7d1852,
     0xb1dd309f, 0x4cc780c5, 0xd86616eb, 0xf2b59180, 0x5b42d922, 0x4b310dbf, 0x0883bdfa, 0xb6995ad0,
     0x71f3ea7b, 0x993e0096, 0x6d8eec83, 0xdce82f0a, 0x97033242, 0x6b4f37b5, 0xce378fbf, 0xb8a30d37,
     0xb4c2bc51, 0x3606cdc3, 0x2f70d327, 0xdf0d33a1, 0xeac1d5c1, 0xaf4320ab, 0xd5692675, 0x26a61bd0,
     0xa1d10ceb, 0xca27cd94, 0x459434a1, 0xa32e848e, 0x7c022c67, 0xbe14b2e8, 0x44a1eae4, 0xaba76be3,
     0x61a8430f, 0xfeaaea51, 0xd88275b7, 0xd1520c19, 0x74519efc, 0x41cad3b6, 0x446843d3, 0xedb0e5b8,
     0x1bcfca86, 0x7a960b41, 0x0fc30032, 0x1182b289, 0xfb339347, 0xdf6e6d5b, 0xfd44990b, 0x94c87196,
     0xf8cf0718, 0xe5f318ad, 0x13de3bd9, 0x0ac55e28, 0x38327311, 0x41076720, 0x96c05455, 0x49f8f7c7,
     0x202e648c, 0xe8caf8dd, 0x0b5b9076, 0x6523f83c, 0x54d5a722, 0x0e9da94d, 0x3861dc77, 0xb4475f91,
     0xba7748ac, 0x2a229519, 0x20c366cf, 0xc9a4690e, 0x76a49542, 0xef391b2a, 0x0ab19939, 0x7cbd913d,
     0xee2f1b3e, 0x5403d6a9, 0x7a9c24ae, 0xdf5197e6, 0xc728a639, 0x8ce1a5ff, 0x3537f465, 0x49627612,
     0xe6e0440b, 0x0d75a3d4, 0x407134d9, 0x4f316b0c, 0x6fe842ce, 0x8ca02f13, 0xe07b53c1, 0xc53ff45a,
     0xc7112ddb, 0xfe81e4e4, 0x9bc7fd18, 0xc04ccdc7, 0x956dd2cb, 0x987ba1af, 0x34061f17, 0x965bf45b,
     0xbc4b3d76, 0xce2e811f, 0xb228e735, 0xdbaba660, 0x613dbcf6, 0x577ce31b, 0x595fc12d, 0x64be5f5f,
     0xea15dca3, 0x268563ce, 0xae1b5af6, 0x4755dc1f, 0xfce26a17, 0x72aadd9f, 0x760e9fcb, 0xd8711bac,
     0x7cf7722c, 0xae8c7038, 0xb629be25, 0xac52594c, 0x8ee442f8, 0x900d7883, 0xb39c23bb, 0x997b128a,
     0x987967d7, 0x0d4d91a7, 0xf3d87b88, 0xb4ab032f, 0x3ec9ae60, 0x5aae9a0e, 0x3990b4c4, 0x50e42a43,
     0x6724246d, 0xecd0af61, 0x8cb3f9e8, 0x0567c410, 0x351b1516, 0x77942c89, 0x3072b9ad, 0xa5b54d1e,
     0x107f0fb5, 0xf21bb0af, 0xaa3fa10c, 0x478e8336, 0x9b61dfe3, 0x90c7173c, 0xc0cb9c3f, 0x3ff56262,
     0xbb139179, 0xc8387ed9, 0x7506d9be, 0x232928ea, 0x9724738f, 0x4d50416f, 0x0f21c442, 0xc7ac5158,
     0x9266137f, 0x152fff27, 0x148f0ac4, 0x403f9a74, 0x51eb3be2, 0x5536946a, 0x48ff997e, 0xe4e20248,
     0xba02fb90, 0x82061de1, 0xb0629de7, 0x48d8c31c, 0xf23e9ea4, 0x5181f774, 0x91ea83ba, 0x3fa05c79,
     0x5e6fb274, 0xb7c7be4e, 0x7008f8ef, 0xe0fc8a2a, 0xa2a5049c, 0xe83a51d7, 0x126ceac0, 0x80ed4935,
     0xa433a1f3, 0x5b7accb7, 0x7d0885a4, 0xb2b4d7e5, 0x88a9d593, 0xc3688cd9, 0xf50c3656, 0x4ed2b1c2,
     0xb4d82fd5, 0x16252e64, 0xfeeaabce, 0x66079296, 0xcdd17a51, 0x8a138fc3, 0x5f53cf45, 0x51567a69,
     0xb7e6c3e1, 0x92d2cc9d, 0x1c37d134, 0xa4fea485, 0x98a6599e, 0xe44342dd, 0x7ac71e54, 0x32818d72,
     0xd5e3c7e0, 0x74888eaa, 0xff76619f, 0x13a0f3fa, 0x12afdb42, 0x79018d6e, 0x6ef2894d, 0x995bd225,
     0x3559a29b, 0x67505cd2, 0xce2fc2d7, 0x5bf5683d, 0x63746804, 0xf25458c0, 0x635c79f6, 0x2ded31ca,
     0x00cfbcd7, 0x11311e5f, 0xb2ea5ca4, 0x2505eb95, 0xb27d69ad, 0xf7458b19, 0x808b5719, 0x973e93a8,
     0x5dce7d5f, 0x1a33bc97, 0xd23097ce, 0x19d9654c, 0x27534405, 0x2fdb0ec2, 0xed09897c, 0x7f56de08,
     0x75dd4dfa, 0x2b5e1ec3, 0x5788db1c, 0xde78bca8, 0xec7d63d4, 0x431ec903, 0xd35e79e8, 0x8b3efc32,
     0x7084946f, 0xecbb2d2a, 0x687b9057, 0x1deadaf2, 0x26832ce2, 0xda16a523, 0x5a108d24, 0x66fdd36e,
     0x754bba87, 0x0451cf16, 0x2e901e47, 0x7d38a571, 0x00ee09f7, 0x9dcc886c, 0xa9a92ffa, 0xb69b4d04,
     0xacbb270a, 0x1c28edcd, 0xd04fedb4, 0xa769076f, 0xa04461da, 0x34475c24, 0xe9b1c630, 0x2421513b,
     0x3e5b43c0, 0xdb497098, 0x77406566, 0x4285e732, 0x2e109c54, 0x468f0794, 0x41aeba8f, 0x5796c65d,
     0x53b37770, 0xeabb3ebf, 0x4becef24, 0xf7952c03, 0xd3d7212d, 0x7bad7304, 0xda2a72df, 0xf80296b0,
     0x124c29e4, 0xf086418a, 0x73daf1b8, 0x6e9fc02a, 0xb6235a2d, 0x7da886bb, 0xdbac58e8, 0xae6ea87d,
     0xa4adc3e2, 0x96b35f41, 0x1892d5e8, 0x4eae8aef, 0x017bae1b, 0xf1882a03, 0x6dbdd371, 0x22e1e40b,
     0x315eab33, 0x8449822b, 0x619d017d, 0x3fc7729a, 0xd96885c1, 0x82564622, 0xb8e44b44, 0xfb6332a4,
     0xe0e84b9f, 0x61509191, 0x7782df3f, 0xebf46072, 0x687148e5, 0xd619c161, 0xe3a92827, 0xe2fc7a8e,
     0xd9d209ed, 0xd5d174bb, 0x81c9d5f5, 0xf73c3cc0, 0xd61e5d50, 0x95d98508, 0x1794d3e3, 0x7fb5a412,
     0x45a44fe7, 0x8ad213f1, 0xa8fb4d69, 0x0ea8eecc, 0x4bf72dca, 0x689e795f, 0x7b2eb240, 0x79959878,
     0x4ce78453, 0x255e567b, 0x149fae61, 0xd63e5fde, 0xee85201b, 0xf77185ae, 0x38fe2e05, 0x79a43f08,
     0x15220ffa, 0x517a25a0, 0xec3d60a6, 0xf708753e, 0xe74f9f0a, 0xe959913c, 0x758cb0fc, 0x26eb7f0a,
     0xc9dd5aa4, 0xb43068aa, 0x595dcb00, 0x1a0e1934, 0x5fdd1060, 0xe65f8552, 0x5b619eeb, 0x297141c5,
     0x8fa1cc18, 0xf68707df, 0x82885736, 0xe7573407, 0x7eb8dce5, 0x988a4938, 0x1204619b, 0x293f6e82,
     0x90f4cd20, 0xc088ea88, 0x90456c12, 0x05ebac00, 0x6b676c61, 0xa4e2c636, 0xc1fd62d4, 0xcf5bec89,
     0xf361c582, 0xba39f9ec, 0xaa1d725a, 0x1dd26b67, 0x4f72279c, 0xb56fe294, 0x90d5085d, 0xc3cfa522,
     0xe16d1c07, 0x8ba41d55, 0xf997d1d7, 0xd6145784, 0x5162745d, 0x713a8699, 0xa813ba00, 0xaca37f95,
     0x82a23b77, 0xdbd13c09, 0xa43bf151, 0xd9ba5a9e, 0x9abebd6e, 0x804a9b8e, 0x313fe283, 0x32dd6429,
     0xfd87889a, 0x54c63f51, 0xd4913a90, 0xcdcc5bfe, 0x510e6995, 0x8ba707bb, 0x52e2e7af, 0xfe873b27,
     0x7ba46c38, 0x9c8d0f75, 0xb122155b, 0x5b5041ed, 0x9fdbe09b, 0x3a5ab468, 0x3483314c, 0xb8a8ecd7,
     0x23825018, 0x5b2e92bd, 0x6275e87b, 0x2b50f6b1, 0xacab8948, 0x346a88dd, 0xffaa2822, 0x08495e81,
     0x1ea89a03, 0x3aafb271, 0x10121cb9, 0xe4d36192, 0x9f09ce63, 0x22df6d61, 0xdadf34f8, 0x94717b6d,
     0x939eb4c1, 0xe01a56d8, 0xe2821adb, 0x2ee26ada, 0xa07a16b6, 0xabc24a3e, 0xedabbd98, 0x07282ae3,
     0xabed041a, 0xf776663b, 0x014c49a9, 0xb384f9cf, 0xd988ca07, 0x781a06ba, 0x61952bc8, 0x0776532a,
     0x8e1cf4d6, 0x24ccc9e2, 0x94f810ed, 0x18c1f6bb, 0x6fba501f, 0x30ef8b1e, 0x5e26e651, 0x3c64de8b,
     0x63b3eabc, 0x11236915, 0xc40fd96d, 0x08a149e4, 0x8d9811c6, 0x7c49c0b2, 0x0be456fb, 0x50f9b44e,
     0x523b5095, 0x66832d1c, 0xb9180bf2, 0x292ddb93, 0x59ab75c3, 0x04318dbd, 0x9159e38d, 0xe83ebbbb,
     0x853b8d29, 0xcaf5fd3e, 0x9a9b0d44, 0x236c920f, 0xfb7ae5e0, 0x6faeda89, 0x180df6d1, 0xaf39dc19,
     0x213b0940, 0xe67fc1c5, 0x8f20492b, 0x9f6757a2, 0x9c8ec7e3, 0x66c98f5c, 0xc787f58d, 0x4af400b2,
     0x51c32ca2, 0x622c61f7, 0xc230266f, 0x45241392, 0x646d8495, 0x9089957f, 0xc64f4a8a, 0x64770dcc,
     0x3b5c5e16, 0xe501c61d, 0x58520cd7, 0xbcadac28, 0x7aa185be, 0x96f6d23a, 0x3eed5b90, 0xa3c8edb0,
     0x078d0766, 0x1708d67e, 0x7c0f632d, 0xad0a0cac, 0x07b23126, 0x1f182fd4, 0x57e99267, 0xaff186a6,
     0xdedf8f58, 0xa2487a64, 0x54ee9437, 0xbf411966, 0x3226ef94, 0xd4f89497, 0x38cc56d6, 0x31fac2f5,
     0xe8d95eb5, 0x2bc99b15, 0x087705be, 0x9b5cbd9d, 0x248729d2, 0x5c9deac9, 0x0a1e0ea6, 0xd1e987e7,
     0x4c03dc44, 0x5d941fda, 0xc1321f89, 0xe862de9b, 0x045c46a6, 0x610f17b3, 0xf465249f, 0x36c8bfc2,
     0x33e572cf, 0xddb0f0fb, 0xa7a84a62, 0x4f5c66a6, 0xfb2eaed9, 0x8857059d, 0x1f2bff89, 0x099e51cf,
     0xc408861c, 0x5625f4c0, 0xe160ef0f, 0x78513c07, 0x3184c833, 0x7b7c9ace, 0xb2f7072c, 0xf1742556,
     0x28f382f5, 0x6efc1571, 0x98e27459, 0x0a494806, 0xcde6fe7b, 0xe286c090, 0xd652a450, 0x9751239f,
     0x862ecc20, 0xcd3c3955, 0xf3b74308, 0xae4d72ea, 0xf8dcb77b, 0x647e5e29, 0xb3c33ebc, 0xa23d33f1}};

static unsigned sha1_raw_outputs[13][6] = {
    {0xda39a3ee, 0x5e6b4b0d, 0x3255bfef, 0x95601890, 0xafd80709, 0x0},
    {0xc1dfd96e, 0xea8cc2b6, 0x2785275b, 0xca38ac26, 0x1256e278, 0x0},
    {0x0a1c2d55, 0x5bbe431a, 0xd6288af5, 0xa54f93e0, 0x449c9232, 0x0},
    {0xbf36ed5d, 0x74727dfd, 0x5d7854ec, 0x6b1d4946, 0x8d8ee8aa, 0x0},
    {0xb78bae6d, 0x14338ffc, 0xcfd5d5b5, 0x674a275f, 0x6ef9c717, 0x0},
    {0x60b7d5bb, 0x560a1acf, 0x6fa45721, 0xbd0abb41, 0x9a841a89, 0x0},
    {0xa6d33845, 0x9780c083, 0x63090fd8, 0xfc7d28dc, 0x80e8e01f, 0x0},
    {0x860328d8, 0x0509500c, 0x1783169e, 0xbf0ba0c4, 0xb94da5e5, 0x0},
    {0x24a2c34b, 0x97630527, 0x7ce58c2f, 0x42d50920, 0x31572520, 0x0},
    {0x411ccee1, 0xf6e3677d, 0xf1269841, 0x1eb09d3f, 0xf580af97, 0x0},
    {0xa70cfbfe, 0x7563dd0e, 0x665c7c67, 0x15a96a8d, 0x756950c0, 0x0},  // SHA1ShortMsg 512
    {0x4a75a406, 0xf4de5f9e, 0x1132069d, 0x66717fc4, 0x24376388, 0x0},  // SHA1LongMsg 2096
    {0xb09d1a96, 0x3ba9bf92, 0x907707b7, 0xd48b96e0, 0xd37dbd79, 0x0}}; // SHA1LongMsg 51200

static void sha1_init_buf(unsigned idx, token_t *mem, token_t *gold_outputs, unsigned *raw_in_words, unsigned *raw_out_words, unsigned raw_inputs[][1600], unsigned raw_outputs[][6])
{
    int j;

    printf("INFO: mem @%p\n", mem);
    printf("INFO: sha1_raw_in_words %u\n", raw_in_words[idx]);
    printf("INFO: sha1_raw_out_words %u\n", raw_out_words[idx]);

    for (j = 0; j < raw_in_words[idx]; j++)
    {
        mem[j] = raw_inputs[idx][j];
#ifdef __DEBUG__
        printf("  sha1_raw_inputs[%u][%u] %x\n", idx, j, raw_inputs[t][j]);
#endif
    }

#ifdef __DEBUG__
    printf("  gold output data @%p\n", gold_outputs);
#endif

    for (j = 0; j < raw_out_words[idx]; j++) {
        gold_outputs[j] = raw_outputs[idx][j];
#ifdef __DEBUG__
        printf("  raw_outputs[%u][%u] %x\n", idx, j, raw_outputs[t][j]);
#endif
    }
}

#endif
